package com.ruoyi.project.manhua.webLook.controller;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.manhua.webLook.service.impl.MhIndexServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.Collections;


/**
 * 漫画章节 Controller
 *
 * @author yuan
 * @date 2021-01-13
 */
@Controller
@RequestMapping("/manhua/look")
public class MhIndexController extends BaseController
{
    private String prefix = "manhua/look";


    @Autowired
    private MhIndexServiceImpl mhIndexService;

    /**
     * 首页请求
     * @return
     */
    @GetMapping("/index")
    public String index()
    {
        return prefix+"/index";
    }

    /*首页轮播图请求*/
    @GetMapping("/sliding")
    public String sliding()
    {
      return prefix+"/sliding";
    }

    @PostMapping("/indexData")
    @ResponseBody
    public  AjaxResult indexData(){
        /*返回给前端首页所有的数据*/
        AjaxResult ajaxResult =mhIndexService.selectIndexData();
        return ajaxResult;
    }

    //@PostMapping("/slidingData")
    @ResponseBody
    public  AjaxResult  slidingData(){
        return new AjaxResult(Collections.singletonList(mhIndexService.seletWebLimitList()));
    }




}
